home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Information / CSMP Digest / volume 1 / csmp-v1-126.txt < prev    next >
Encoding:
Text File  |  1994-12-08  |  36.3 KB  |  1,133 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Mon, 29 Jun 92       Volume 1 : Issue 126
  2.  
  3. Today's Topics:
  4.  
  5.     TCL and Popup Menus
  6.     Emacs v. MPW shell (was Re: Think C vs. MPW)
  7.     Quicktime Question (Standard Compression Dialog)
  8.     TCL Depository (was TCL and Popup Menus)
  9.     How to tell is in color or gray
  10.     Comm Toolbox / THINK C Strangeness
  11.     Finding the System Folder
  12.     Process Manager & Hiding...
  13.     MPW Software for sale
  14.     How to use XTND in programs?
  15.     How to get KeyDown event without WaitNextEvent
  16.     HELP: How do I tell the finder I have changed a name??
  17.     NEEDED: 2 dimensional fast fourier transform
  18.     Grep on Mac
  19.  
  20.  
  21.  
  22. -------------------------------------------------------
  23.  
  24. From: gregt@function.mps.ohio-state.edu (Gregory M Ferrar)
  25. Subject: TCL and Popup Menus
  26. Organization: Department of Mathematics, The Ohio State University
  27. Date: Wed, 27 May 1992 04:32:40 GMT
  28.  
  29. I've been using THINK C for a while now, but I'm just now getting into the
  30. Class Library.  In my normal C programming, I make extensive use of popup
  31. menus.  However, I don't see a CPopupMenu, or any obvious way of using the
  32. existing menu support to make popups.  Am I missing something obvious?  Is
  33. there a CPopupMenu somewhere out there?  If not, would anyone want one if I
  34. wrote it?
  35.  
  36.   -Greg Ferrar (gregt@function.mps.ohio-state.edu)
  37.  
  38. +++++++++++++++++++++++++++
  39.  
  40. From: gregt@function.mps.ohio-state.edu (Gregory M Ferrar)
  41. Organization: Department of Mathematics, The Ohio State University
  42. Date: Wed, 27 May 1992 17:20:24 GMT
  43.  
  44. |> I've been using THINK C for a while now, but I'm just now getting into the
  45. |> Class Library.  In my normal C programming, I make extensive use of popup
  46. |> menus.  However, I don't see a CPopupMenu, or any obvious way of using the
  47. |> existing menu support to make popups.  Am I missing something obvious?  Is
  48. |> there a CPopupMenu somewhere out there?  If not, would anyone want one if I
  49. |> wrote it?
  50.  
  51. Thank you, all who responded to my post above.  CPopupPane was right under my
  52. nose, in the TCL Folder!  The confusing thing is that it is not mentioned
  53. anywhere in the OOP manual.  The subclasses of CControl are listed as
  54. CScrollBar and CButton (which in turn has subclasses CCheckBox and
  55. CRadioControl).  Now I can understand not documenting classes like CStaticText,
  56. which is supplied for compatibility only, but something as useful as CPopupPane
  57. should really be findable without doing a Finder search!  What's up here?
  58.  
  59.   -Greg Ferrar (gregt@function.mps.ohio-state.edu)
  60.  
  61. ---------------------------
  62.  
  63. From: cory@enigami.mv.com (Cory Kempf)
  64. Subject: Emacs v. MPW shell (was Re: Think C vs. MPW)
  65. Date: 27 May 92 03:31:05 GMT
  66. Organization: EnigamI, Inc., Nashua, NH
  67.  
  68.  
  69. In article <25175@goofy.Apple.COM> (comp.sys.mac.programmer), ksand@apple.com (Kent Sandvik) writes:
  70. >In article <1992May16.232022.7679@verity.com>, anders@verity.com (Anders
  71. >Wallgren) writes:
  72. >> I agree - the _only_ reason that I still prefer Unix to MPW is simple
  73. >> - GNU Emacs.  It is by far the most useful tool I use.
  74. >
  75. >I'm curious, if Apple would make a new development environment including
  76. >new editors, would GNU key-bindings be something people would ask for?
  77. >I guess most of you know of Alpha (the Emacs style MacOS editor).
  78.  
  79. Actually, it is not the key bindings that I miss about emacs, but
  80. the modes.  Especially the [electric | eclectic] [C | C++] modes.
  81.  
  82. I tried to program them into MPW a while back using the SetKey function,
  83. but it was just too limited.  For example, in one of those modes,
  84. if I begin a line with:
  85.  
  86. #in
  87.  
  88. emacs would give me:
  89.  
  90. #include "|"
  91.  
  92. (the | is the insertion point).  This saves a LOT of typing.  It did
  93. several other things to save my poor wrists as well, and I could customize
  94. its auto indent based on how *I* liked to view my code.
  95.  
  96. All of this is impossible to impliment from within MPW.
  97.  
  98. Another very usefult feature of emacs is the ability to compile common
  99. scripts.  I would really love to be able to compile my startup scripts.
  100. With the frequency that I have to reboot, that alone could save me
  101. probably 30 minutes / day.
  102.  
  103. +C
  104.  
  105.  
  106.  
  107. - -------------------------------------------------------------
  108. Cory Kempf                    EnigamI, Inc.
  109. cory@enigami.mv.com           ...!decvax!enigami!cory
  110. Microsoft Free and Proud Of It!... 
  111.                            ...Microsoft Products: Just Say no.
  112.  
  113. +++++++++++++++++++++++++++
  114.  
  115. From: ksand@apple.com (Kent Sandvik)
  116. Date: 28 May 92 01:07:14 GMT
  117. Organization: MacDTS Mongols
  118.  
  119. In article <0105011F.4gr58q@dragon.enigami.mv.com>, cory@enigami.mv.com (Cory
  120. Kempf) writes:
  121. >> I tried to program them into MPW a while back using the SetKey function,
  122. > but it was just too limited.  For example, in one of those modes,
  123. > if I begin a line with:
  124. > #in
  125.  
  126. > emacs would give me:
  127. > #include "|"
  128.  
  129. > (the | is the insertion point).  This saves a LOT of typing.  It did
  130. > several other things to save my poor wrists as well, and I could customize
  131. > its auto indent based on how *I* liked to view my code.
  132.  
  133. True, I like macros as well, and Object Master actually provides something
  134. similar.
  135.  
  136. > Another very usefult feature of emacs is the ability to compile common
  137. > scripts.  I would really love to be able to compile my startup scripts.
  138. > With the frequency that I have to reboot, that alone could save me
  139. > probably 30 minutes / day.
  140.  
  141. True again, the only way to speed up things in MPW today is to convert scripts 
  142. to tools, something which I support with scripts which are used 
  143. over-and-over-and-over-and..
  144. - --
  145.                                               Cheers, Kent
  146.  
  147.  
  148.  
  149. ---------------------------
  150.  
  151. Organization: Johannes Kepler University Linz - Computing Center
  152. Date: Wednesday, 27 May 1992 09:06:34 CDT
  153. From: Norbert Mueller <K360171@ALIJKU11.BITNET>
  154. Subject: Quicktime Question (Standard Compression Dialog)
  155.  
  156. Hello,
  157. I have been looking for a documentation of the StandardCompression
  158. Utilities (Those QuickTime routines starting with SC...) that are
  159. used in some sample code onthe QT CD-ROM. It seems it is not in the
  160. docs on the CD ROM. Also there is no statement if it is legal to use
  161. the resources in the sample projects (THINK C). Anybody more informed
  162. than I am ?
  163.  
  164. Thanks
  165. N. Mueller (Inst. of Chemistry, Johannes Kepler Univ., Linz, Austria)
  166.  
  167. +++++++++++++++++++++++++++
  168.  
  169. From: ivanski@world.std.com (Ivan M CaveroBelaunde)
  170. Organization: The World Public Access UNIX, Brookline, MA
  171. Date: Wed, 27 May 1992 17:37:59 GMT
  172.  
  173. Norbert Mueller <K360171@ALIJKU11.BITNET> writes:
  174.  
  175. >Hello,
  176. >I have been looking for a documentation of the StandardCompression
  177. >Utilities (Those QuickTime routines starting with SC...) that are
  178. >used in some sample code onthe QT CD-ROM. It seems it is not in the
  179. >docs on the CD ROM. Also there is no statement if it is legal to use
  180. >the resources in the sample projects (THINK C). Anybody more informed
  181. >than I am ?
  182.  
  183. The Standard Compression component is documented in an Inside Mac Viewer
  184. file called "StdCompression" in the same folder where the std compression
  185. .h, sample code, and resource files sit on the QT 1.0 Dev CD.
  186.  
  187. My understanding is that this component will be rolled into QuickTime itself
  188. in the future. The glue code checks if there is already a 'scdi' component
  189. registered with the system, and if there isn't, it registers and calls the
  190. one in the Application. You probably are free to use it in noncommercial
  191. programs, but you might need to license it (as part of QuickTime) for
  192. commercial distribution (I think Apple charges $50 a year or so for all of QT).
  193. You should probably contact them.
  194.  
  195. Hope this helps,
  196.  
  197. - -Ivanski
  198. - ---
  199. Ivan Cavero Belaunde (ivanski@world.std.com)
  200. DiVA Corporation
  201.  
  202.     "A tu escuela llegue, sin entender por que llegaba,
  203.     En tus salones encuentro, mil caminos y encrucijadas,
  204.     Y aprendo mucho ... Y no aprendo na'a ...
  205.     !Maestra vida, camara', te da, te quita, te quita y te da..."
  206.         -Ruben Blades, "Maestra Vida"
  207.  
  208.  
  209. ---------------------------
  210.  
  211. From: jstevens@crick.ssctr.bcm.tmc.edu (Jason Philip Stevens)
  212. Subject: TCL Depository (was TCL and Popup Menus)
  213. Date: 27 May 1992 15:06:53 GMT
  214. Organization: Baylor College of Medicine, Houston, Tx
  215.  
  216.  
  217. In article <1992May27.043240.11138@zaphod.mps.ohio-state.edu>, gregt@function.mps.ohio-state.edu (Gregory M Ferrar) writes:
  218. |> I've been using THINK C for a while now, but I'm just now getting into the
  219. |> Class Library.  In my normal C programming, I make extensive use of popup
  220. |> menus.  However, I don't see a CPopupMenu, or any obvious way of using the
  221. |> existing menu support to make popups.  Am I missing something obvious?  Is
  222. |> there a CPopupMenu somewhere out there?  If not, would anyone want one if I
  223. |> wrote it?
  224.  
  225. There must be a "central" depository for TCL classes like this;  if not there
  226. should be, I bet we could all save ourselves a lot of work by browsing through
  227. stuff that others have written...
  228.  
  229. Anyone know of such a place or volunteer to set one up?
  230.  
  231. - -jps
  232. - -- 
  233. Jason Stevens            Internet:  jstevens@bcm.tmc.edu
  234. Network User Services        Voice:  (713) 798-7370
  235. Baylor College of Medicine    Opinions expressed are mine alone.
  236.  
  237.  
  238. +++++++++++++++++++++++++++
  239.  
  240. From: medwards@phoenix.Princeton.EDU (Michael Kenneth Edwards)
  241. Date: 27 May 92 16:11:08 GMT
  242. Organization: Princeton University
  243.  
  244.  
  245. The official Think C ftp site is ics.uci.edu, directory /mac/think-c.
  246. Symantec and others (?) distribute sample code and goodies here. I don't
  247. know what the upload policy is. However, may I suggest that interested
  248. parties join the tcl-talk mailing list? The subscription address is
  249. tcl-talk-request@brown.edu. There is an associated ftp site, ftp.brown.edu,
  250. where digests and contributed classes are archived. I know there's a set
  251. of popup tear-off menu support classes there -- I contributed them. (There
  252. are some distribution restrictions, pending polishing, since it's still at
  253. the beta stage.) The dialog classes shipped with TCL 1.1.x also include
  254. a popup menu class. I haven't played with it -- I wrote mine before TCL 1.1
  255. came out, and it handles rather more than just text menus. If you want
  256. the system-7-standard behavior, though, with the little arrow and whatnot,
  257. check out Symantec's class. Mine was written for tool palettes and behaves
  258. differently.
  259.  
  260. - - "Kenny Bob"
  261. (medwards@astro.princeton.edu)
  262.  
  263. +++++++++++++++++++++++++++
  264.  
  265. From: molla@paone.uucp (Levent Mollamustafaoglu)
  266. Date: 27 May 92 16:21:51 GMT
  267. Organization: Aiken Computation Lab, Harvard University
  268.  
  269. jstevens@crick.ssctr.bcm.tmc.edu (Jason Philip Stevens) writes:
  270. >
  271. >gregt@function.mps.ohio-state.edu (Gregory M Ferrar) writes:
  272.  
  273. >There must be a "central" depository for TCL classes like this;  if not there
  274. >should be, I bet we could all save ourselves a lot of work by browsing through
  275. >stuff that others have written...
  276. >
  277. >Anyone know of such a place or volunteer to set one up?
  278. >
  279.  
  280. Actually, there is a TCL list, which you can join by sending a message to
  281. tcl-request@brown.edu. The list accepts articles at tcl-talk@brown.edu and
  282. it also has an ftp site at ftp.brown.edu, in directory /pub/tcl. You can
  283. ask how to submit classes by a message to tcl-request@brown.edu. As far as
  284. I remember, there was something done on pop-up menus.
  285.  
  286.  
  287. ===========================================================================
  288. Dr. Levent Mollamustafaoglu       Harvard University    
  289. molla@paone.harvard.edu    molla@metatron.harvard.edu
  290. ===========================================================================
  291.  
  292. ---------------------------
  293.  
  294. From: wolf@piquet.cipl.uiowa.edu (Michael J. Wolf)
  295. Subject: How to tell is in color or gray
  296. Date: 27 May 92 15:47:04 GMT
  297. Organization: Cardiovascular Image Processing Lab, U of Iowa
  298.  
  299. How can one tell if I am in a world of grays and not colors?
  300.  
  301. I don't recall anything for this, is there a Gestalt selector I am
  302. missing?  And how does one check this using sysenviron?  I must
  303. use sysenviron in one project and have gestalt glue code for
  304. the other.
  305.  
  306. I need to know if I should load an 8 bit color or gray clut.
  307.  
  308. All help appreciated.
  309.  
  310. MJW
  311.  
  312.  
  313.  
  314. +++++++++++++++++++++++++++
  315.  
  316. From: buckeye@spf.trw.com (John Wallace)
  317. Date: 28 May 92 21:39:25 GMT
  318. Organization: TRW Data Systems Center, Redondo Beach, CA
  319.  
  320. In article <12805@ns-mx.uiowa.edu> wolf@piquet.cipl.uiowa.edu (Michael J. Wolf) writes:
  321. >How can one tell if I am in a world of grays and not colors?
  322. >
  323. >I don't recall anything for this, is there a Gestalt selector I am
  324. >missing?  And how does one check this using sysenviron?  I must
  325. >use sysenviron in one project and have gestalt glue code for
  326. >the other.
  327. >
  328. >I need to know if I should load an 8 bit color or gray clut.
  329. >
  330. >All help appreciated.
  331. >
  332. >MJW
  333. >
  334. >
  335.  
  336. Check the gdFlags for the GDevice in InsideMac V-131.  
  337. If bit 0 = 0, then you are in grayscale (IM says mono, but
  338. it really means grayscale from what I've seen), and 
  339. if bit 0 = 1, then you are in color.
  340.  
  341. Cheers!
  342. John
  343. - ----
  344. John Wallace    buckeye@spf.trw.com
  345.  
  346. ---------------------------
  347.  
  348. From: edw@caligula.cts.com (Ed Watkeys)
  349. Subject: Comm Toolbox / THINK C Strangeness
  350. Date: Wed, 27 May 92 14:19:48 EDT
  351. Organization: Distant Software
  352.  
  353. Okay, when I run this code, THINK C tells me that gConnection is equal to
  354. 0x00000000. But it won't execute ExitToShell! Is this incredible stupidity
  355. on my part or something going wrong? (I'm assuming the former for now...)
  356.  
  357.     procID = CMGetProcID("\pAppleTalk ADSP Tool");
  358.     gConnection = CMNew(procID,cmQuiet+cmNoMenus,sizes,666L,666L);
  359.     if (gConnection == NULL) {
  360.         ExitToShell;    
  361.         }
  362.  
  363. Just as an aside, this code was working fine until I changed *something* (which
  364. I can't remember).
  365.  
  366. Thanks,
  367. Ed
  368.  
  369. - --
  370. Ed Watkeys, Sys Admin.  "...The errors of great men are more venerable
  371. Distant Software         because they are more fruitful than the truths
  372. edw@caligula.cts.com     of little men..."  -- Friedrich Nietzsche
  373.  
  374. +++++++++++++++++++++++++++
  375.  
  376. From: edw@caligula.cts.com (Ed Watkeys)
  377. Date: Wed, 27 May 92 15:51:54 EDT
  378. Organization: Distant Software
  379.  
  380.  
  381. In article <01050133.4iio42@caligula.cts.com> (comp.sys.mac.programmer), edw@caligula.cts.com (Ed Watkeys) writes:
  382.  
  383. I was correct: I am a moron. This is what I get for switching between C and
  384. Pascal constantly.
  385.  
  386. >     procID = CMGetProcID("\pAppleTalk ADSP Tool");
  387. >     gConnection = CMNew(procID,cmQuiet+cmNoMenus,sizes,666L,666L);
  388. >     if (gConnection == NULL) {
  389. >         ExitToShell;
  390.                           ^--- should have () here.    
  391. >         }
  392. >
  393. Ed
  394.  
  395. - --
  396. Ed Watkeys, Sys Admin.  "...The errors of great men are more venerable
  397. Distant Software         because they are more fruitful than the truths
  398. edw@caligula.cts.com     of little men..."  -- Friedrich Nietzsche
  399.  
  400. +++++++++++++++++++++++++++
  401.  
  402. From: russotto@eng.umd.edu (Matthew T. Russotto)
  403. Date: Thu, 28 May 92 19:33:55 GMT
  404. Organization: College of Engineering, University of Maryland, College Park
  405.  
  406. In article <01050133.4iio42@caligula.cts.com> edw@caligula.cts.com (Ed Watkeys) writes:
  407. >Okay, when I run this code, THINK C tells me that gConnection is equal to
  408. >0x00000000. But it won't execute ExitToShell! Is this incredible stupidity
  409. >on my part or something going wrong? (I'm assuming the former for now...)
  410. >
  411. >    procID = CMGetProcID("\pAppleTalk ADSP Tool");
  412. >    gConnection = CMNew(procID,cmQuiet+cmNoMenus,sizes,666L,666L);
  413. >    if (gConnection == NULL) {
  414. >        ExitToShell;    
  415. >        }
  416.  
  417. It may not exit to shell, but it might just put $A9F4 in the low word
  418. of D0.
  419.  
  420. You forgot the parentheses:  ExitToShell()
  421.  
  422.  
  423.  
  424. - -- 
  425. Matthew T. Russotto    russotto@eng.umd.edu    russotto@wam.umd.edu
  426. Some news readers expect "Disclaimer:" here.
  427. Just say NO to police searches and seizures.  Make them use force.
  428. (not responsible for bodily harm resulting from following above advice)
  429.  
  430. ---------------------------
  431.  
  432. From: kamprath@caen.engin.umich.edu (Michael F. Kamprath)
  433. Subject: Finding the System Folder
  434. Date: Wed, 27 May 92 22:06:57 EDT
  435. Organization: The University of Michigan, Ann Arbor
  436.  
  437. How would my program find the system folder in order to save a preference file
  438. there?  Also, how would it tell the difference between a system 6 & 7 folder, 
  439. so that it would save the preference file to the preference folder in system 7?
  440. Basically, I want the finding of the preference file to be transparent to the 
  441. user, and if it can't find one, a default pref. file would be created there.
  442.  
  443. I am using THINK C 4.0.5.
  444.  
  445. Thanks for any help.
  446.  
  447. Michael Kamprath
  448. kamprath@caen.engin.umich.edu
  449.  
  450.  
  451. +++++++++++++++++++++++++++
  452.  
  453. From: James.W.Osborne@dartmouth.edu (James W. Osborne)
  454. Date: 29 May 92 01:30:58 GMT
  455. Organization: Dartmouth College, Hanover, NH
  456.  
  457. In article <3m8+H4#@engin.umich.edu>
  458. kamprath@caen.engin.umich.edu (Michael F. Kamprath) writes:
  459.  
  460. > How would my program find the system folder in order to save a preference file
  461. > there?  Also, how would it tell the difference between a system 6 & 7 folder, 
  462. > so that it would save the preference file to the preference folder in system 7?
  463. > Basically, I want the finding of the preference file to be transparent to the 
  464. > user, and if it can't find one, a default pref. file would be created there.
  465. > I am using THINK C 4.0.5.
  466. > Thanks for any help.
  467. > Michael Kamprath
  468. > kamprath@caen.engin.umich.edu
  469.  
  470.  
  471.   Following is some sample code that is a class based on CResFile.  It
  472. implements a preferences file for TCL under System 6 or 7.  I make no
  473. claims other than it works for me, and no guarantees except that you'll
  474. have to modify it to work for your individual needs.
  475.  
  476. ####### CPrefResFile.h ###########
  477. #include <CResFile.h>
  478.  
  479. class CPrefResFile : public CResFile {
  480.  
  481.  public:
  482.      void    IPrefResFile(void);
  483.      void    Dispose(void);
  484.      
  485.      void    Open(SignedByte permission);
  486.      OSErr    GetPrefFile();
  487.      OSErr    MakeNewPrefFile(void);
  488. };
  489.  
  490.  
  491. ######## CPrefResFile.c ##############
  492. #include <OSUtils.h>
  493. #include <TBUtilities.h>
  494. #include <stdio.h>
  495.  
  496. #include "CPrefResFile.h"
  497.  
  498. #define PREF_FILE_NAME "\pYour pref file name"
  499.  
  500. extern CTalkApp    *gApplication;
  501.  
  502. void    CPrefResFile::IPrefResFile()
  503. {
  504.     CResFile::IResFile();
  505. }
  506.  
  507. void    CPrefResFile::Open(SignedByte permission)
  508. {
  509.     Boolean wasLocked;
  510.     
  511.     ASSERT( IsOpen() == FALSE);
  512.  
  513.     wasLocked = Lock( TRUE);
  514.     refNum = HOpenResFile(volNum, dirID, name, permission);
  515.     Lock( wasLocked);
  516.     
  517.     if (refNum == -1)
  518.         refNum = 0;
  519. }
  520.  
  521. OSErr CPrefResFile::GetPrefFile()
  522. {
  523.     Str63        temp;
  524.     OSErr        err = 0;
  525.     short        lVolNum;
  526.     long        lDirID;
  527.     
  528.     SysEnvRec    theSysEnv;
  529.     
  530.     if (gSystem.systemVersion < 0x0700) {
  531. //        Find the System Folder
  532.         err = SysEnvirons (1, &theSysEnv);
  533.         lVolNum = theSysEnv.sysVRefNum;
  534.         
  535.         Specify(temp, lVolNum);
  536.     }
  537.     else {
  538.         err = FindFolder(kOnSystemDisk, kPreferencesFolderType,
  539. kDontCreateFolder,
  540.                 &lVolNum, &lDirID);
  541.         if (err != noErr)
  542.             ErrorDialog("Failure in opening preferences file:", err);
  543.  
  544. //        Call the Specify
  545.         SpecifyHFS(temp, lVolNum, lDirID);    
  546.     }
  547.  
  548. //    Now try to open it.  This method is overridden because we don't
  549. //    want the error dialog
  550.     if (!IsOpen())
  551.         Open(fsRdWrPerm);
  552.         
  553. //    If there was no file, make a new one
  554.     if (refNum == 0)
  555.         MakeNewPrefFile();
  556.         
  557.     return noErr;
  558. }
  559.         
  560. void CPrefResFile::Dispose()
  561. {
  562.     inherited::Dispose();
  563. }
  564.  
  565.  
  566. OSErr    CPrefResFile::MakeNewPrefFile() 
  567. {
  568.     Handle    prefsHandle;
  569.     FInfo    finderinfo;
  570.     OSErr    err;
  571.     
  572.     CreateNew('CREATOR_ID', 'PREF');
  573.     Open(fsRdWrPerm);
  574.     prefsHandle = NewHandle(sizeof(struct Preferences));
  575.     FailMemError();
  576.     
  577.     HLock(prefsHandle);
  578.     BlockMove(gApplication->thePrefs, *prefsHandle, sizeof(struct
  579. Preferences));
  580.     ReplaceResource(prefsHandle, 'PREF', rStdPrefs, "\pStandard Prefs",
  581. refNum, 0);
  582.     Update();
  583.     HUnlock(prefsHandle);
  584. }
  585.  
  586.  
  587.  
  588.  
  589. Here's some sample code on how I call it from my app's initialization
  590. routine...
  591.  
  592.  
  593. //    *** PREFERENCES
  594.     thePrefs = (struct Preferences *) NewPtr(sizeof(struct Preferences));
  595.     FailMemError();
  596.     
  597.     thePrefs->in_conn = kICWait;
  598.     thePrefs->sess_man = kSMConditional;
  599.     thePrefs->numShortcuts = 0;
  600.     strncpy(thePrefs->name, shortName, NAME_SIZE);
  601.     
  602. //    Create the pref file object
  603.     prefFile = new CPrefResFile;
  604.     prefFile->IPrefResFile();
  605. //    Get the prefRef
  606.     prefFile->GetPrefFile();
  607.     prefFile->MakeCurrent();
  608.  
  609. //    Now get the Preferences from the file
  610.     prefsHandle = GetPrefRes('PREF', rStdPrefs);   // *** Sorry, I can't
  611. give you the code to GetPrefRes.  It's not mine to give, but it
  612. basically does a Get1Resource with wrapper...
  613.     if (!prefsHandle) {
  614.         ErrorDialog("Problem with the preferences file.", 0);
  615.         return FALSE;
  616.     }
  617.     else {
  618.         BlockMove(*prefsHandle, thePrefs, (Size) sizeof(struct Preferences));
  619. //        ForgetResource(prefsHandle);
  620. //        FailResError();
  621.     }
  622.     prefFile->Close();
  623.  
  624.  
  625.  
  626.  
  627. I hope this can help you out.  Perhaps if someone were to generalize it
  628. more, it could go up on the TCL ftp site.  If someone does decide to do
  629. that, please give credit where it is due.  Thanks.
  630.  
  631.  
  632. - -Jamie Osborne
  633. jwo@dartmouth.edu
  634.  
  635. ---------------------------
  636.  
  637. From: rsherman@mthvax.cs.miami.edu (Roby Sherman)
  638. Subject: Process Manager & Hiding...
  639. Date: 28 May 92 14:33:56 GMT
  640. Organization: The Tao of Programming
  641.  
  642. I must be going blind... I've been searching around IM vol 6 for the
  643. command used to hide a process, but have found nothing. Is this
  644. information in IM Or must I refer to some external source? If anyone has
  645. info on how to do this, please leave me e-mail or post it to the net.
  646.  
  647.  
  648.                thanks.
  649.  
  650.                  Roby 
  651. - -- 
  652. rsherman@mthvax.cs.miami.edu                    Roby Sherman
  653.  
  654. +++++++++++++++++++++++++++
  655.  
  656. From: nerm@apple.com (Dean Yu)
  657. Date: 28 May 92 23:36:57 GMT
  658. Organization: Apple Computer, Inc.
  659.  
  660. In article <102r0kINNco2@mthvax.cs.miami.edu>, rsherman@mthvax.cs.miami.edu (Roby Sherman) writes:
  661. > I must be going blind... I've been searching around IM vol 6 for the
  662. > command used to hide a process, but have found nothing. Is this
  663. > information in IM Or must I refer to some external source? If anyone has
  664. > info on how to do this, please leave me e-mail or post it to the net.
  665. >                thanks.
  666. >                  Roby 
  667. > -- 
  668.  
  669.   Hiding a process's layer is not a public interface.
  670.  
  671.   -- Dean Yu
  672.      Blue Meanie, Negative Ethnic Role Model
  673.      Apple Computer, Inc.
  674.      blah blah blah blah blah
  675.  
  676.  
  677. ---------------------------
  678.  
  679. From: neal@farallon.com (Neal Trautman)
  680. Subject: MPW Software for sale
  681. Date: 27 Apr 92 14:58:28 GMT
  682. Organization: Farallon Computing, Inc.
  683.  
  684.  
  685. Macintosh Programming Software and Manuals for sale
  686.  
  687. Macintosh Programmer's Workshop (MPW) v3.1
  688. MPW Assembler v3.1
  689. MPW Object Pascal v3.1
  690. MPW C v3.1
  691. MPW C++ v3.1
  692. MacApp v2.0.1
  693. SADE v1.1
  694. MacsBug v6.1
  695. ResEdit v1.2
  696. DTS Tech Notes
  697. Inside Macintosh volumes 1-5
  698.  
  699. All software comes with manuals.
  700. I will consider all offers.
  701.  
  702. Contact:
  703. Neal Trautman
  704. neal@farallon.com
  705. or call (913)832-1723 after 6PM central time.
  706.  
  707. +++++++++++++++++++++++++++
  708.  
  709. From: neal@farallon.com (Neal Trautman)
  710. Date: 27 May 92 13:19:44 GMT
  711. Organization: Farallon Computing, Inc.
  712.  
  713.  
  714. Macintosh Programming Software and Manuals for sale
  715.  
  716. Macintosh Programmer's Workshop (MPW) v3.1
  717. MPW Assembler v3.1
  718. MPW Object Pascal v3.1
  719. MPW C v3.1
  720. SADE v1.1
  721. MacsBug v6.1
  722. ResEdit v1.2
  723.  
  724. All software is in excellent condition and
  725. comes with manuals.  I will consider all offers.
  726.  
  727. Contact:
  728. Neal Trautman
  729. neal@farallon.com
  730. or call (913)832-1723 after 6PM central time.
  731.  
  732. ---------------------------
  733.  
  734. From: karl@sparcom.com (Karl J. Smith)
  735. Subject: How to use XTND in programs?
  736. Date: 10 May 92 02:58:46 GMT
  737. Organization: Sparcom Corp., Corvallis/Tigard, Oregon
  738.  
  739. I'm looking into adding XTND support to an application I've written, and
  740. need to know where to start. Whom at Claris should I contact? How much
  741. does the license cost? How much code does it take to support XTND? Is there
  742. an easy way to add XTND support to MacApp programs? Any answers would
  743. be appreciated.
  744.  
  745. Karl Smith
  746. karl@sparcom.com
  747.  
  748. +++++++++++++++++++++++++++
  749.  
  750. From: drc@claris.com (Dennis Cohen)
  751. Date: 11 May 92 13:26:00 GMT
  752. Organization: Claris Corporation, Santa Clara CA
  753.  
  754. karl@sparcom.com (Karl J. Smith) writes:
  755.  
  756. >I'm looking into adding XTND support to an application I've written, and
  757. >need to know where to start. Whom at Claris should I contact? How much
  758. >does the license cost? How much code does it take to support XTND? Is there
  759. >an easy way to add XTND support to MacApp programs? Any answers would
  760. >be appreciated.
  761.  
  762. You should contact APDA.  Apple acquired the rights to XTND from Claris
  763. last year and started shipping the XTND Developer Kit in August.  The kit
  764. is $30 and includes the license.  It really doesn't take much code to
  765. support XTND, sample programs supporting XTND are included in the package
  766. in both C and Pascal (both MPW and THINK).  I am not aware of anyone
  767. providing an XTND Class for MacApp, but it is pretty easy to add XTND
  768. support to a MacApp-based program (just function calls, after all).  Tom
  769. Chavez was interested in adding XTND support into MacApp last year, but
  770. I don't know whether anything ever came of it.
  771.  
  772. - --Dennis
  773.  
  774. - -- 
  775. Dennis Cohen
  776. Claris Corp.
  777.  ****************************************************
  778. Disclaimer:  Any opinions expressed above are _MINE_!
  779.  
  780. +++++++++++++++++++++++++++
  781.  
  782. From: nilesinc@well.sf.ca.us (Avi Rappoport)
  783. Date: 18 May 92 23:36:33 GMT
  784. Organization: Whole Earth 'Lectronic Link
  785.  
  786. In <544@sparcom.sparcom.com> karl@sparcom.com (Karl J. Smith) writes:
  787.  
  788. >I'm looking into adding XTND support to an application I've written, and
  789. >need to know where to start. Whom at Claris should I contact? How much
  790. >does the license cost? How much code does it take to support XTND? Is there
  791. >an easy way to add XTND support to MacApp programs? Any answers would
  792. >be appreciated.
  793.  
  794. I'm not sure where XTND is going, and would recommend that you hold off
  795. for the moment.  For gamblers, the XTND 1.3 package from APDA will probably
  796. be pretty compatible with any (definatively _unannounced_) future versions.
  797.  
  798. Avi.
  799.  
  800. - -- 
  801. - --  Ask me about EndNote and EndNote Plus Bibliography Makers            --
  802. Avi Rappoport                               2000 Hearst, Berkeley, CA 94709
  803. nilesinc@well.sf.ca.us,                                        510-649-8176
  804. Niles.Assoc on AppleLink                              fax: 510-649-8179                 
  805.  
  806. +++++++++++++++++++++++++++
  807.  
  808. From: chandhok+@cs.cmu.edu (Ravinder Chandhok)
  809. Date: Wed, 27 May 92 16:01:00 GMT
  810. Organization: School of Computer Science, Carnegie Mellon
  811.  
  812. In article 39429 drc@claris.com writes:
  813. >in both C and Pascal (both MPW and THINK).  I am not aware of anyone
  814. >providing an XTND Class for MacApp, but it is pretty easy to add XTND
  815. >support to a MacApp-based program (just function calls, after all).  Tom
  816. >Chavez was interested in adding XTND support into MacApp last year, but
  817. >I don't know whether anything ever came of it.
  818.  
  819. I wrote an XTND package for MacApp, which has been mostly used in 2.0, but
  820. also had the headers ported to 3.0/C++.  It provides an easy way to read in
  821. both text (into TEViews or chains of TEViews) and pictures via XTND.  We use
  822. it in the PREP Editor.
  823.  
  824. I think Tom Chavez knows about it (I certainly tried to tell him) but I have
  825. never had any conversation with him about it.
  826.  
  827. Rob
  828. - -- 
  829. Ravinder (Rob) Chandhok              Internet : chandhok+@cs.cmu.edu
  830. Carnegie Mellon University           AppleLink: A14
  831.  
  832.  
  833. ---------------------------
  834.  
  835. From: nyang@Bonnie.ICS.UCI.EDU
  836. Subject: How to get KeyDown event without WaitNextEvent
  837. Date: 19 May 92 20:59:33 GMT
  838.  
  839.  
  840. Someone please help me with this...
  841.  
  842.    Can I get a Keydown event without using WaitNextEvent function?  The
  843. reason why I want to do that is becasue my program clears the whole screen, and
  844. when I call WaitNextEvent to get user keyboard input, the menu bar gets redrawn.
  845. But, I don't want to redraw the menu bar!  If this can't be done, can someone
  846. tell me how to tell WaitNextEvent not to redraw the menu bar?
  847.  
  848.    Please don't flame me if this is a stupid question.  Thank you very much
  849. for any help in advance.
  850.  
  851. Nick Yang   nyang@bonnie.ics.uci.edu
  852.  
  853. +++++++++++++++++++++++++++
  854.  
  855. From: mxmora@unix.SRI.COM (Matt Mora)
  856. Date: 26 May 92 17:52:48 GMT
  857. Organization: SRI International, Menlo Park, California
  858.  
  859. In article <9205191359.aa25006@Bonnie.ics.uci.edu> nyang@Bonnie.ICS.UCI.EDU writes:
  860. >
  861. >Someone please help me with this...
  862. >
  863. >   Can I get a Keydown event without using WaitNextEvent function?  The
  864.  
  865. Not really, but you can look at the keymap by using the 
  866. GetKeys(var k:KeyMap); call . This will return in the kemap array flags
  867. telling you which buttons are being held down.
  868.  
  869. >reason why I want to do that is because my program clears the whole screen,and
  870. >when I call WaitNextEvent to get user keyboard input, the menu bar gets 
  871. >redrawn.
  872.  
  873. Are you writting a game? You will probably need to hide the menu bar. Or as 
  874. Tog says  "change it to the same color as the background." 
  875.  
  876. >   Please don't flame me if this is a stupid question.  Thank you very much
  877. >for any help in advance.
  878.  
  879. The only stupid question is the one not asked. :-)
  880.  
  881.  
  882. Matt
  883.  
  884.  
  885.  
  886.  
  887.  
  888. - -- 
  889. ___________________________________________________________
  890. Matthew Mora                |   my Mac  Matt_Mora@sri.com
  891. SRI International           |  my unix  mxmora@unix.sri.com
  892. ___________________________________________________________
  893.  
  894. ---------------------------
  895.  
  896. From: kevin@crash.cts.com (Kevin Hill)
  897. Subject: HELP: How do I tell the finder I have changed a name??
  898. Organization: Crash TimeSharing, El Cajon, CA
  899. Date: Wed, 20 May 1992 06:48:58 GMT
  900.  
  901.   I am using a program that changes the name of files..  I have noticed that if
  902. I try to delete a file that has had its name changed, and the window containing
  903. that file was open during the change, I get a file not found error.  However, 
  904. if I then close the window and the open it again, it deletes it no problem..
  905.   Is there a special message that I want to send to the finder whenever I
  906. try to change a file that will update the finders name lists?
  907.  
  908.   -Kevin
  909.  
  910.  
  911. +++++++++++++++++++++++++++
  912.  
  913. From: jpugh@apple.com (Jon Pugh)
  914. Date: 23 May 92 05:34:15 GMT
  915. Organization: Apple Computer, Inc.
  916.  
  917. In article <1992May20.064858.9915@crash.cts.com>, kevin@crash.cts.com (Kevin Hill) writes:
  918. >   I am using a program that changes the name of files..  I have noticed that if
  919. > I try to delete a file that has had its name changed, and the window containing
  920. > that file was open during the change, I get a file not found error.  However, 
  921. > if I then close the window and the open it again, it deletes it no problem..
  922. >   Is there a special message that I want to send to the finder whenever I
  923. > try to change a file that will update the finders name lists?
  924. >   -Kevin
  925.  
  926. The Finder caches tons o' stuff now.  You can get it to flush its cache by
  927. changing the modification date of the containing folder (i.e. the open 
  928. window).  This will make the Finder update the window.
  929.  
  930. Jon
  931.  
  932. ---------------------------
  933.  
  934. From: jafl@cco.caltech.edu (John Lindal)
  935. Subject: NEEDED: 2 dimensional fast fourier transform
  936. Organization: California Institute of Technology, Pasadena
  937. Date: Wed, 20 May 1992 19:14:54 GMT
  938.  
  939. Does anyone have code that will calculate 2 dimensional fast fourier
  940. transforms?  Code is the best, but perhaps you know where I should post this
  941. to get more responses or where to look for code.
  942.  
  943. Thanks in advance. John Lindal
  944.  
  945. +++++++++++++++++++++++++++
  946.  
  947. From: walsteyn@fys.ruu.nl (Fred Walsteijn)
  948. Date: 22 May 92 08:50:18 GMT
  949. Organization: Physics Department, University of Utrecht,  The Netherlands
  950.  
  951. In <1992May20.191454.12784@cco.caltech.edu> jafl@cco.caltech.edu (John Lindal) writes:
  952.  
  953. >Does anyone have code that will calculate 2 dimensional fast fourier
  954. >transforms?  Code is the best, but perhaps you know where I should post this
  955. >to get more responses or where to look for code.
  956.  
  957. 1. The Numerical Recipes disk(s) contain a 2D FFT (f77, cc, pascal).
  958. 2. I believe there are also public domain FFT codes (f77 and cc) in netlib.
  959.  
  960. You may get more responses if you post to "sci.math.num-analysis".
  961. - -----------------------------------------------------------------------------
  962. Fred Walsteijn                                | Internet: walsteyn@fys.ruu.nl
  963. Institute for Marine and Atmospheric Research | FAX:      31-30-543163
  964. Utrecht University, The Netherlands           | Phone:    31-30-533169
  965.  
  966. +++++++++++++++++++++++++++
  967.  
  968. From: howard@rigel.cs.pdx.edu (howard l. berkey)
  969. Date: 26 May 92 23:11:56 GMT
  970. Organization: /etc/organization
  971.  
  972. In article <1992May22.085018.3772@fys.ruu.nl> walsteyn@fys.ruu.nl (Fred Walsteijn) writes:
  973. >In <1992May20.191454.12784@cco.caltech.edu> jafl@cco.caltech.edu (John Lindal) writes:
  974. >
  975. >>Does anyone have code that will calculate 2 dimensional fast fourier
  976. >>transforms?  Code is the best, but perhaps you know where I should post this
  977. >>to get more responses or where to look for code.
  978. >
  979. >1. The Numerical Recipes disk(s) contain a 2D FFT (f77, cc, pascal).
  980. >2. I believe there are also public domain FFT codes (f77 and cc) in netlib.
  981. >
  982.  
  983. Better yet, write your own!  There are many algorithms; I have found these 
  984. sources the most useful:    
  985.  
  986. "Numerical Methods for Engineers", Chapra and Canale, 2nd ed., McGraw Hill
  987.  
  988. "Algorithms in C", Robert Sedgewick, Addison-Wesley
  989.  
  990. Also, for more FFT info, read various articles in the ACM journal by Cooley, 
  991. Tukey, and Sande, although this gets pretty thick.
  992.  
  993. - -Howard
  994. - -----------------------------------------------------------------------------
  995. Make mine a '99'!                      howard@rigel.cs.pdx.edu
  996.               Kick Back For The Rave Alarm
  997. Howard Berkey, permanent undergrad, soon to get the Hell out of Dodge........
  998.  
  999. ---------------------------
  1000.  
  1001. From: fang@phy.duke.edu (Fang Zhong)
  1002. Subject: Grep on Mac
  1003. Date: 21 May 92 02:04:44 GMT
  1004.  
  1005.  
  1006.     I am looking for an application or a MPW tool which can find
  1007. the documents in one folder that contain a given string.
  1008.     Any lead?
  1009.     Thanks in advance.
  1010.  
  1011. - -- 
  1012.     Fang Zhong                1-919-684-8247
  1013.     Duke University Dept. of Physics    fang@phy.duke.edu
  1014.     Durham, N.C.      27706            
  1015.  
  1016. +++++++++++++++++++++++++++
  1017.  
  1018. From: molla@paone.uucp (Levent Mollamustafaoglu)
  1019. Date: 21 May 92 05:06:09 GMT
  1020. Organization: Aiken Computation Lab, Harvard University
  1021.  
  1022. In article <2982@news.duke.edu> fang@phy.duke.edu (Fang Zhong) writes:
  1023. >
  1024. >    I am looking for an application or a MPW tool which can find
  1025. >the documents in one folder that contain a given string.
  1026. >    Any lead?
  1027.  
  1028. Try Rich Siegel's excellent freeware editor BBEdit, which you can 
  1029. find at sumex-aim.stanford.edu, under info-mac/app. Maybe you might
  1030. alsolike to use it as an editor, in addition to grep'ping with it. :-)
  1031.  
  1032.  
  1033. ===========================================================================
  1034. Dr. Levent Mollamustafaoglu       Harvard University    
  1035. molla@paone.harvard.edu    molla@metatron.harvard.edu
  1036. ===========================================================================
  1037.  
  1038. Newsgroups : 
  1039. ZZSubject: Re: Grep on Mac
  1040. References: <2982@news.duke.edu>
  1041. Sender: 
  1042. Followup-To: 
  1043. Distribution: 
  1044. Organization: Aiken Computation Lab, Harvard University
  1045. Keywords: search documents containing a given string
  1046.  
  1047. In article <2982@news.duke.edu> fang@phy.duke.edu (Fang Zhong) writes:
  1048. >
  1049. >    I am looking for an application or a MPW tool which can find
  1050. >the documents in one folder that contain a given string.
  1051. >    Any lead?
  1052.  
  1053. Try Rich Siegel's excellent freeware editor BBEdit, which you can 
  1054. find at sumex-aim.stanford.edu, under info-mac/app. Maybe you might
  1055. alsolike to use it as an editor, in addition to grep'ping with it. :-)
  1056.  
  1057.  
  1058. ===========================================================================
  1059. Dr. Levent Mollamustafaoglu       Harvard University    
  1060. molla@paone.harvard.edu    molla@metatron.harvard.edu
  1061. ===========================================================================
  1062.  
  1063. +++++++++++++++++++++++++++
  1064.  
  1065. From: curreyr@cs.orst.edu (Robert Currey)
  1066. Date: 21 May 92 20:27:09 GMT
  1067. Organization: Oregon State University
  1068.  
  1069. In article <1992May21.050609.4076@das.harvard.edu>, molla@paone.uucp (Levent Mollamustafaoglu) writes:
  1070. > In article <2982@news.duke.edu> fang@phy.duke.edu (Fang Zhong) writes:
  1071. > >
  1072. > >    I am looking for an application or a MPW tool which can find
  1073. > >the documents in one folder that contain a given string.
  1074. > >    Any lead?
  1075. > Try Rich Siegel's excellent freeware editor BBEdit, which you can 
  1076. > find at sumex-aim.stanford.edu, under info-mac/app. Maybe you might
  1077. > alsolike to use it as an editor, in addition to grep'ping with it. :-)
  1078. I use the MPW command string:
  1079.  
  1080. search /STRING/ `files -o -f  -r -t TEXT "DIR"`
  1081.  
  1082. This will find STRING in all text files in the directory DIR.
  1083. If DIR is omitted then the current directory is used. I'm sure 
  1084. if you wanted you could emulate the unix grep command by using a 
  1085. script that munged the grep parameters into the search commands 
  1086. needs.
  1087.  
  1088. - -Rob
  1089.  
  1090. +++++++++++++++++++++++++++
  1091.  
  1092. From: zben@ni.umd.edu (Charles B. Cranston)
  1093. Organization: UM Home for the Terminally Analytical
  1094. Date: Tue, 26 May 1992 21:27:16 GMT
  1095.  
  1096. In article <1992May21.202709.8315@CS.ORST.EDU>, curreyr@cs.orst.edu (Robert Currey) writes:
  1097.  
  1098. > I use the MPW command string:
  1099. > search /STRING/ `files -o -f  -r -t TEXT "DIR"`
  1100.  
  1101. Why not use the filename explosion stuff built into the shell?
  1102. I have these lines at the top of my worksheet:
  1103.  
  1104. Search -i /PBGetCatInfoSync/ "{CIncludes}"?*.h
  1105. Search -i /SFSaveDisk/ "{PInterfaces}"?*.p
  1106. Search -i /windowkind/ "{AIncludes}"?*.a
  1107.  
  1108. Whenever I need to find something in the includes I type it over the
  1109. text between the slashes and execute it.  There is actually a single
  1110. symbol that can replace ?* but it is one of the macintosh above-ascii
  1111. symbols and so I cannot quote it here...
  1112.  
  1113.  
  1114. ---------------------------
  1115.  
  1116. End of C.S.M.P. Digest
  1117. **********************
  1118.